import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Window {
    width: 640
    height: 480
    visible: true
    title: "QML对话框示例"

    ColumnLayout {
        anchors.centerIn: parent
        spacing: 20

        Label {
            text: "QML对话框示例"
            font.pixelSize: 24
            font.bold: true
            Layout.alignment: Qt.AlignHCenter
        }

        Button {
            text: "基础消息对话框"
            Layout.preferredWidth: 200
            onClicked: messageDialog.open()
        }

        Button {
            text: "自定义表单对话框"
            Layout.preferredWidth: 200
            onClicked: formDialog.open()
        }

        Button {
            text: "文件选择对话框"
            Layout.preferredWidth: 200
            onClicked: filePickerDialog.open()
        }
    }

    BasicMessageDialog {
        id: messageDialog
        width: 300
        height: 200
        anchors.centerIn: parent
        messageText: "这是一个演示用的消息对话框！"
    }

    CustomFormDialog {
        id: formDialog
        width: 300
        height: 200
        anchors.centerIn: parent
    }

    FilePickerDialog {
        id: filePickerDialog
        width: 300
        height: 200
        anchors.centerIn: parent
    }
}
